; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s

define void @test(i8 %arg) nounwind {
; CHECK-LABEL: test:
; CHECK:       // %bb.0:
; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; CHECK-NEXT:    and w9, w0, #0xff
; CHECK-NEXT:    mov w8, #1
; CHECK-NEXT:    cmp w9, #1
; CHECK-NEXT:    cset w0, ne
; CHECK-NEXT:    strb w0, [sp, #12]
; CHECK-NEXT:    cbz w8, .LBB0_2
; CHECK-NEXT:  // %bb.1: // %do_call
; CHECK-NEXT:    bl unknown
; CHECK-NEXT:  .LBB0_2: // %common.ret
; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT:    ret
  %tmp = alloca i8
  %cmp1 = icmp ne i8 %arg, 1
  %zext = zext i1 %cmp1 to i8
  store i8 %zext, ptr %tmp
  %zext2 = load i8, ptr %tmp
  %cmp2 = icmp eq i8 %zext2, 3
  br i1 %cmp2, label %exit, label %do_call

do_call:
  call void @unknown(i8 %zext2)
  ret void

exit:
  ret void
}

declare void @unknown(i8)
